<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\models\EduMenu */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Edu Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="edu-menu-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'title',
//            'icon',
            [
                'attribute' => 'icon',
                'format' => ['image', [
                    'width' => '100%',
                    'height' => '100%',
                ]],
//                'value' => function ($model) {
//                    if ($model->icon) {
//                        return Yii::$app->params['localUrl'] . $model->icon;
//                    }
//                    return $model->icon;
//                }
            ],
            'sort',
//            'style',
            [
                'attribute' => 'style',
                'value' => $model::attributeValue()['style'][$model->style]
            ],
            [
                'attribute' => 'status',
                'value' => $model->getStatusValue(),
            ],
            'url:url',
            'des',
        ],
    ]) ?>

</div>
